<template>
  <div class="commenticon" @click="gooPinion"></div>
</template>

<script>
export default {
  name: "CommentIcon",
  methods: {
    gooPinion() {
      if (this.$Cookie.get("userid") == null) {
        this.$confirm("检测到未登录是否进行登录?", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {
            this.$router.push("/login2");
          })
          .catch(() => {});
      } else {
        this.$router.push("/opinion");
      }
    },
  },
};
</script>

<style>
.commenticon {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translate(0, -50%);
  width: 59px;
  height: 86px;
  z-index: 2;
  background: url("../../assets/img/feedback.png") left center/contain no-repeat;
  cursor: pointer;
}
</style>